﻿package plugin.roletwo
{
    import morn.core.components.*;
    import uiresource.roleui.*;

    public class Armitem2Ctrl extends Armitem2UI
    {
        public var baseicon:String = "";
        private var _data:Object = null;

        public function Armitem2Ctrl()
        {
            return;
        }// end function

        override protected function createChildren() : void
        {
            loadUI("Armitem2.xml");
            item.flagshow = false;
            item.mouseEnabled = false;
            item.mouseChildren = false;
            return;
        }// end function

        public function get data() : Object
        {
            return this._data;
        }// end function

        public function set data(param1:Object) : void
        {
            this._data = param1;
            this._data.wear = 1;
            var _loc_2:* = this.item.getChildByName("bg") as UrlImage;
            if (this.data == null)
            {
                this.item.data = {icon:this.baseicon};
                _loc_2.visible = false;
            }
            else if (!this._data.hasOwnProperty("icon"))
            {
                this.item.data = {icon:this.baseicon};
                _loc_2.visible = false;
            }
            else
            {
                this.item.data = this._data;
                _loc_2.visible = true;
            }
            this.item.changeSuperLvXY(8, 2);
            return;
        }// end function

    }
}
